"""\
GamePauseMenuFrame is a class provide a frame with some menu button when game pause.
It includes five buttons:
    btn_Continue for "Continue" -> messenger.send(event_GAME_GAMERESUME)
    btn_Configure for "Configure" -> messenger.send(event_GAME_GAMECONFIGURE)
    btn_Restart for "Restart" -> messenger.send(event_GAME_GAMELOAD)
    btn_MainMenu for "Main Menu" -> messenger.send(event_GAME_BACKTOMAINMENU)
    btn_Exit for "Exit" -> sys.exit

and driven state changed in GameFSM

GamePauseMenuFrame.__init__(self)
    Create a GamePauseMenuFrame.
"""
# event
from Shell.data.GameEventDefine import event_GAME_BACKTOMAINMENU, event_GAME_GAMELOAD, event_GAME_GAMERESUME, event_GAME_GAMECONFIGURE
# gui
from direct.gui.DirectGui import DirectFrame, DirectButton
from Cube.gui.DirectGUIPropertiesAccess import BtnTextSet
# uiString
from Shell.data.UIString import uiString
# sys.exit
import sys

class GamePauseMenuFrame(DirectFrame):
    def __init__(self):
        """\
GamePauseMenuFrame.__init__(self)
    Create a GamePauseMenuFrame."""
        DirectFrame.__init__(self)

        frame_Board = DirectFrame(parent=self,
                                  frameColor=(0.4,0.4,0.4,0.9),
                                  frameSize=(-0.9,0.9,-0.9,0.9))

        scale=0.08
        btnFrameSize = (-7,7,-0.5,1)
        btn_Continue = DirectButton(parent=self,
                                    scale=scale,
                                    pos =(0,0,0.1),
                                    frameSize = btnFrameSize,
                                    command= messenger.send,
                                    extraArgs = [event_GAME_GAMERESUME]
                                    )
        btn_Configure = DirectButton(parent=self,
                                     scale=scale,
                                     pos =(0,0,-0.1),
                                     frameSize = btnFrameSize,
                                     command= messenger.send,
                                     extraArgs = [event_GAME_GAMECONFIGURE]
                                     )
        btn_Restart = DirectButton(parent=self,
                                   scale=scale,
                                   pos =(0.5,0,-0.5),
                                   frameSize = (-3,3,-0.6,1),
                                   command= messenger.send,
                                   extraArgs = [event_GAME_GAMELOAD]
                                   )
        btn_MainMenu = DirectButton(parent=self,
                                    scale=scale,
                                    pos =(0,0,-0.5),
                                    frameSize = (-3,3,-0.6,1),
                                    command= messenger.send,
                                    extraArgs = [event_GAME_BACKTOMAINMENU]
                                    )
        btn_Exit = DirectButton(parent=self,
                                scale=scale,
                                pos =(-0.5,0,-0.5),
                                frameSize = (-3,3,-0.6,1),
                                command= sys.exit
                                )
        BtnTextSet(btn_Continue, uiString["Continue"])
        BtnTextSet(btn_Configure, uiString["Configure"])
        BtnTextSet(btn_Restart, uiString["Restart"])
        BtnTextSet(btn_MainMenu, uiString["Main Menu"])
        BtnTextSet(btn_Exit, uiString["Exit"])

